from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from webboard import views

app_name = 'webboardApp'
urlpatterns = [
    # 评论区url
    path('category/', csrf_exempt(views.TypeList.as_view()), name='评论区主页'),
    path('post/<int:category_id>/', csrf_exempt(views.PostList.as_view()), name='帖子主页'),
    path('post/getallpost/', csrf_exempt(views.GetAllPosts.as_view()), name='获取帖子'),

    path('addpost/<int:category_id>/', csrf_exempt(views.PostAddView.as_view()), name='发表帖子'),
    path('remarkinfo/<int:post_id>/', csrf_exempt(views.remarkinfo.as_view()), name='帖子内容'),
    path('remarkinfo/addremark/', csrf_exempt(views.AddRemarkView.as_view()), name='增加评论'),
    path('get_comments/', views.get_comments, name='获取评论'),
    path('remarkinfo/post/like/', csrf_exempt(views.PostLikeNumber.as_view()), name='帖子点赞'),
    path('remarkinfo/post/unlike/', csrf_exempt(views.PostUnlikeNumber.as_view()), name='帖子差评'),
    path('remarkinfo/remark/like/', csrf_exempt(views.RemarkClickLike.as_view()), name='评论点赞'),
    path('remarkinfo/remark/unlike/', csrf_exempt(views.RemarkClickunLike.as_view()), name='评论差评'),
    path('remarkinfo/remark/reply/', csrf_exempt(views.RemarkClickReply.as_view()), name='回复评论'),
    path('remarkinfo/remark/reply/like/', csrf_exempt(views.ReplyClickLike.as_view()), name='回复点赞'),
    path('remarkinfo/remark/reply/unlike/', csrf_exempt(views.ReplyClickunLike.as_view()), name='回复差评'),
    path('remarkinfo/remark/reply/addreply/', csrf_exempt(views.ReplyClickReply.as_view()), name='创建子回复'),
]
